

$('#calendar').fullCalendar({
  header: {
    left: 'today prev,next',
    center: 'title',
    right: ''
  },
  monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
  monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
  dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  today: ["今天"],
  firstDay: 1,
  buttonText: {
    today: '本月',
    month: '月',
    week: '周',
    day: '日',
    prev: '上一月',
    next: '下一月'
  },
  loading: function (bool) {
    if (bool) {
      console.log('loading');
    } else {
      console.log('complete');
    }
  },
  dayClick: function (date, jsEvent, view) {//日期点击后弹出的jq ui的框，添加日程记录
  },
  eventClick: function(calEvent, jsEvent, view) {
  },
  eventAfterRender: function (event, element, view) {
  }
});

var getList = function (obj) {
  var id = window.location.href;
  id = id.slice(id.lastIndexOf('/') + 1);
  $.ajax({
    cache: false,
    async: false,
    url: '/api/CommonApi?API=GetScheduleTeachers',
    type: 'get',
    data: {
      ProjectScheduleID: id
    },
    dataType: 'json',
    success: function (data) {
      console.log(data)
      var newData = data.ApiParamObj[0];
      if (data.Success) {
        document.getElementById('listTeacher').innerHTML = template('teacherList', newData);
      }
    }
  });
};

getList({
  callback: function (data) {
    console.log(JSON.stringify(data));

  }
});